package com.example.platformsharedcommon.util;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;

/**
 * 继承分页类, 增加一些特殊方法
 *                       
 * @Filename: MyPageInfo.java
 * @Version: 1.0
 * @Author: peter朱硕磊
 * @Email: 455474281@qq.com
 *
 */
public class MyPageInfo<T> extends PageInfo<T> {

    /**
     *Comment for <code>serialVersionUID</code>
     */
    private static final long serialVersionUID = 6458985006784318539L;

    /**
     * 把list转成指定类的集合
     * @param clazz
     * @return
     */
    public List<T> getList2(Class<T> clazz) {
        List<T> obj = super.getList();
        String dataListJson = JSONObject.toJSONString(obj);
        return JSONObject.parseArray(dataListJson, clazz);
    }

}
